<template>
    <div>
      <div class="titleContainer">
        <h1>数据库操作</h1>
      </div>
      <div class="toolContainer">
        <div class="toolBtnContainer">
          <el-button type="success" class="toolBtn" @click="toExcelImportDataPage" round>Excel导入数据</el-button>
        </div>
        <div class="toolBtnContainer">
          <el-button type="success" class="toolBtn" @click="toCreateDBTxtPage" round>生成数据库文件</el-button>
        </div>
        <div class="toolBtnContainer">
          <el-button type="primary" class="toolBtn" @click="changeDB" round>切换数据库</el-button>
        </div>
      </div>
    </div>
</template>

<script>
    export default {
      name: "DBTooolMenu"
      ,data() {
        return {
          excelImportDataUrl: '/excelTableList'
          ,changeDBUrl: '/'
          ,createDBTxtUrl: '/createDBTxt'
        }
      }
      ,methods: {
        toExcelImportDataPage() {
          this.toPage(this.excelImportDataUrl)
        },
        toCreateDBTxtPage() {
          this.toPage(this.createDBTxtUrl)
        }
        ,changeDB() {
          this.toPage(this.changeDBUrl)
        }
        ,toPage(url) {
          this.$router.push(url)
        }
      }
    }
</script>

<style scoped>
  .titleContainer {
    text-align: center;
    margin-top: 20px;
  }
  .toolContainer {
    text-align: center;
    margin-top: 30px;
  }
  .toolBtnContainer {
    width: 100%;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
  }
  .toolBtn {
    width: 200px;
  }
</style>
